Don't use XATTR_REPLACE with lsetxattr()
authorStef Walter <stefw@redhat.com>
Tue, 13 Aug 2013 13:41:12 +0000 (15:41 +0200)
committerStef Walter <stefw@redhat.com>
Tue, 13 Aug 2013 13:42:54 +0000 (15:42 +0200)
If we pass XATTR_REPLACE then the attribute must already exist, which
is not our intent. Passing zero creates the attribute if necessary,
or replaces it when it already exists.

https://bugzilla.gnome.org/show_bug.cgi?id=705893

src/libostree/ostree-core.c

index 7fb4e2f9b41fe2b1eba641f5dd0d882e2ce05b2a..b8f3988454765b4513fd943ecbb93bf4e4437e84 100644 (file)
@@ -860,7 +860,7 @@ ostree_set_xattrs (GFile  *f,
                            &name, &value);
       value_data = g_variant_get_fixed_array (value, &value_len, 1);
       
-      loop_err = lsetxattr (path, (char*)name, (char*)value_data, value_len, XATTR_REPLACE) < 0;
+      loop_err = lsetxattr (path, (char*)name, (char*)value_data, value_len, 0) < 0;
       g_clear_pointer (&value, (GDestroyNotify) g_variant_unref);
       if (loop_err)
         {